<template>
  <ContentWrap
    class="mb-0!"
    :class="[
      footer
        ? '!h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height)-10px)]'
        : '!h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-20px)]'
    ]"
    :bodyStyle="{ height: '100%', paddingLeft: '5px', paddingRight: '5px' }"
  >
    <div class="main-container attachment-container">
      <el-card class="box-card !border-none full-container" shadow="never">
        <el-tabs v-model="type">
          <el-tab-pane
            v-for="item in getIntDictOptions(DICT_TYPE.MATERIAL_FILE_TYPE)"
            :key="item.value"
            :name="item.value"
          >
            <template #label>
              <span>{{ `${item.label}` }}</span>
            </template>
            <attachment scene="attachment" :type="item.value" />
          </el-tab-pane>
        </el-tabs>
        <!-- <el-tabs v-model="type">
          <el-tab-pane
            v-for="item in getIntDictOptions(DICT_TYPE.MATERIAL_FILE_TYPE)"
            :name="item"
            :key="item"
          >
            <attachment scene="attachment" :type="tab" />
          </el-tab-pane>
        </el-tabs> -->
      </el-card>
    </div></ContentWrap
  >
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { t } from '@/lang'
import attachment from '@/views/app/components/upload-attachment/attachment.vue'
import { useRoute } from 'vue-router'
import { useAppStore } from '@/store/modules/app'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'

const appStore = useAppStore()
const footer = computed(() => appStore.getFooter)
const route = useRoute()
const pageName = route.meta.title
const attachmentType: string[] = ['image', 'video', 'doc']
const type = ref(1)
</script>

<style lang="scss">
.attachment-container {
  overflow: hidden;
  min-height: calc(100vh - 94px);
  background-color: var(--el-bg-color-overlay);

  .full-container {
    height: calc(100vh - 100px);
  }

  .el-card__body {
    height: 100%;
  }

  .el-tabs {
    display: flex;
    height: calc(100% - 40px);
  }

  .el-tabs__content {
    flex: 1;

    .el-tab-pane {
      height: 100%;
    }
  }

  .el-tabs__nav-wrap::after {
    height: 1px;
  }

  .main-wrap {
    border: none;

    .group-wrap {
      padding: 0 15px 0 0;
    }

    .attachment-list-wrap {
      padding: 0 0 0 15px;
    }
  }
}
</style>
